/*
 * Created on 7-set-2004
 *
 */
package it.unibo.deis.lia.mmhc.test.logger;

import java.util.logging.*;

/**
 * @author Carlo
 * 
 */
public class CarloFormatter extends Formatter {

	public String format(LogRecord rec) {
		String level = "" + rec.getLevel();
		// System.out.println("rec.getMessage() "+rec.getMessage());
		String time = "" + rec.getMillis();
		String mess;
		// if(rec.getMessage().length()>=12){
		// Utilizzo la nuova feature nanosTime() di 1.5.0
		// StringTokenizer st=new StringTokenizer(rec.getMessage());
		// time=st.nextToken();
		// mess=rec.getMessage().substring(time.length()+1);
		mess = rec.getMessage();
		/*
		 * } else{ time=""+rec.getMillis(); mess=rec.getMessage(); }
		 */
		String fromClass = rec.getSourceClassName();
		String fromMethod = rec.getSourceMethodName();
		return level + ": " + time + " " + fromClass + " " + fromMethod
				+ " mess: " + mess + "\n";
	}

}
